package com.cxx.purchasecharge.service;

import java.util.List;

import com.cxx.purchasecharge.core.model.OrderStatusCode;
import com.cxx.purchasecharge.core.model.persistence.Order;
import com.cxx.purchasecharge.service.exception.PcServiceException;

public interface CoreService
{
    Order saveOrder (Order order) throws PcServiceException;

    boolean updateOrderStatus (long id, OrderStatusCode statusCode, String comment);

    void deleteOrder (Order order) throws PcServiceException;

    void deleteOrders (List <Order> orders) throws PcServiceException;

    boolean isLessThanMinStorage (long goodsId) throws PcServiceException;

    /**
     * 检查货物是否有库存异常，Null表示正常，True表示亏损，False表示溢出
     * @param goodsId
     * @return
     * @throws PcServiceException
     */
    Boolean isStorageException (long goodsId) throws PcServiceException;

    boolean isStorageEnough (long goodsId, int goodsAmount) throws PcServiceException;

}
